﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Coding4Fun.Toolkit.Controls">

	<GridLength x:Key="GridMinimized">48</GridLength>
	
	<Style x:Key="MetroFlowItemTextBlockStyle" TargetType="TextBlock">
		<Setter Property="FontSize" Value="{StaticResource DefaultFontSizeMediumLarge}" />
		<Setter Property="Margin" Value="12, 3, 0, 3" />
		<Setter Property="HorizontalAlignment" Value="Left" />
		<Setter Property="VerticalAlignment" Value="Bottom" />
	</Style>

	<Style x:Key="MetroFlowItemRectangleUnderlay" TargetType="Rectangle">
		<Setter Property="Fill" Value="{StaticResource DefaultChromeBrush}" />
		<Setter Property="Margin" Value="0, -.5" />
		<Setter Property="Opacity" Value=".8" />
	</Style>
	
	<Style x:Key="MetroFlowItemImage" TargetType="Image">
		<Setter Property="Margin" Value="0, -.5, 0, 0" />
		<Setter Property="Stretch" Value="UniformToFill" />
		<Setter Property="HorizontalAlignment" Value="Center" />
		<Setter Property="VerticalAlignment" Value="Center" />
	</Style>
	
	<Style x:Key="MetroFlowItemMainBody" TargetType="Panel">
		<Setter Property="Background" Value="{StaticResource DefaultChromeBrush}" />
		<Setter Property="Margin" Value="6, 0" />
	</Style>

	<Style TargetType="local:MetroFlowItem">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:MetroFlowItem">
					<Grid>
						<Grid Style="{StaticResource MetroFlowItemMainBody}">
							<Rectangle Fill="{StaticResource DefaultAccentBrush}" />
							<Image 
								Source="{TemplateBinding ImageSource}"
								Visibility="{TemplateBinding ImageVisibility}"
								Opacity="{TemplateBinding ImageOpacity}"
								Style="{StaticResource MetroFlowItemImage}" />
							<Grid VerticalAlignment="Bottom">
								<Rectangle 
									Style="{StaticResource MetroFlowItemRectangleUnderlay}" />
								<TextBlock 
									Text="{TemplateBinding Title}"
									Visibility="{TemplateBinding TitleVisibility}"
									Opacity="{TemplateBinding TitleOpacity}"
									Style="{StaticResource MetroFlowItemTextBlockStyle}" />
								<TextBlock 
									Text="{TemplateBinding ItemIndexString}"
									Visibility="{TemplateBinding ItemIndexVisibility}"
									Opacity="{TemplateBinding ItemIndexOpacity}"
									Style="{StaticResource MetroFlowItemTextBlockStyle}" />
							</Grid>
						</Grid>
						<Rectangle Fill="Transparent" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style TargetType="local:MetroFlow">
		<Setter Property="Height" Value="120" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:MetroFlow">
					<Grid Name="LayoutRoot">
						<local:MetroFlowItem Title="MetroFlow Control" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>